<template>
	<view class="cancellation">
		<view style="display: flex;justify-content: center;flex-direction: column;align-items: center;padding: 40rpx 20rpx;">
			<u-image width="129rpx" height="129rpx" src="https://img.koalalf.com/wuyoushenghuo/icon/cancellation.png" mode="widthFix"></u-image>
			<view style="font-size: 28rpx;margin-top: 40rpx;">注销后，你将无法使用当前账号</view>
			<view style="font-size: 28rpx;margin-top: 10rpx;">相关数据也将被删除无法找回</view>
			<view style="color: #d4c8c8;font-size: 22rpx;margin-top: 20rpx;">当前账号188****0125</view>
		</view>
		<view style="padding: 40rpx;margin-top: 40rpx;">
			<u-button type="primary" @click="cancellation()" size="small" shape="circle">注销账号</u-button>
		</view>
		<u-modal :show="modalShow" @confirm="confirm" content='确定要注销账号吗？'></u-modal>
	</view>
</template>

<script>
	import {cancellation} from "@/common/user.api.js"
	export default {
		data() {
			return {
				modalShow: false
			}
		},
		methods: {
			cancellation(){
				this.modalShow = true
				
			},
			confirm(){
				this.modalShow = false
				let that = this
				cancellation({}).then(res => {
					that.$u.route('pages/auth/mobileLogin')
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #fff;
		height: 100vh;
	}
	.cancellation{
		background-color: #fff;
		height: 100vh;
	}
</style>
